import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import MovieSessionsManagement from '../views/MovieSessionsManagement.vue'
import MovieDetail from '../views/MovieDetail.vue'

const routes = [
  {
    path: '/',
    redirect: '/home' // 默认重定向
  },
  {
    path: '/home',
    // name: 'home',
    component: Home // 默认的购票首页
  },
  {
    path: '/movie-sessions-management',
    // name: 'movieSessionsManagement',
    component: MovieSessionsManagement
  },
  {
    path: '/movie-detail/:id',
    // name: 'movieDetail',
    component: MovieDetail
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router